package io.renren.modules.base.utils;

import org.springframework.stereotype.Component;

import com.github.pagehelper.PageInfo;

import io.renren.common.utils.PageUtils;

/**
 * @author kk
 * 分页
 */
@Component
public class PageHelp {

	
	public static PageUtils getPageUtils(PageInfo<?> pageInfo) {
    	
		Long total = pageInfo.getTotal();
		int size = pageInfo.getPageSize();
		int curPage = pageInfo.getPageNum();
		
    	return new PageUtils(pageInfo.getList(),total.intValue(),size, curPage);
    }
}